/**
  * fluid - *** FEATURE NAME *** for *** TARGET PLUGIN NAME ***
  * Copyright *** COPYRIGHT ***
  * 
  * Licensed under the terms of the *** LICENSE NAME *** license. 
  * 
  *     fluid Project: http://fluidjs.codeplex.com/
  *        fluid Blog: http://fluidjs.vikasburman.com
  *
  *    Repository: *** PLUGIN REPOSITORY *** 
  *  Dependencies: 
  * 	- fluid core
  *     - *** ANY OTHER DEPENDENCIES WITH DETAILS ***
  *
  */
(function($f) { $f.extend.feature("*** UNIQUE FEATURE NAME ***", "*** TARGETS ***", "*** GUID ***", function(self) {

	"use strict";
	
	// NOTES: 
	//	1. This feature - plugin template defines majority of structures that can be defined in
	//     a fluid feature plugin. 
	//
	//  2. IMPORTANT: All these definitions are IN ADDITION TO what can be defined for a normal plugin
	//     as specified in "plugin-template.debug.js". All those required structures should be picked from 
	//	   that file.
	//
	//  3. ALL OF THESE ARE OPTIONAL. You should keep only relevant structures that
	//     you are planning to use, and should remove anything which is not used.
	//
	//  4. Refer to http://fluidjs.codeplex.com/documentation to know about all possibilities 
	//     and other details.
	
	// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
	// vvvvvvvvvvvvvvvvvv PRIVATE VARS, FUNCTIONS AND CLASSES vvvvvvvvvvvvvvvvv
	// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv	
	
	// all private variables, functions and classes 
	// can be defined here
	
	// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
	// vvvvvvvvvvvvvvvvvvvvvvvvvvv FEATURE DEFINITION  vvvvvvvvvvvvvvvvvvvvvvvv
	// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
	
	// feature info
	this.featureInfo = {
		title: "",
		version: "", // major.minor.build
		author: "",
		copyright: "",			
		description: "",
		web: ""
		license: {
			text: "",
			url: ""
		}
	};
	
	// feature only (non-merged) handle
	this.featureHandle = {
		// if this feature is an application feature
		// setting this will make it inherit app level version, authour, copyright, web information
		// if not defined here
		isAppFeature: false,		

		// feature merging options 
		// skip merging these members if already defined
		// in plugin
		// only 0 and 1 level are supported
		skipMergingIfDefined: {
			level0: "",
			level1: {
			}
		}
	};
	
	// feature only (non-merged) config
	this.featureConfig = {
		// resource JSON file name of feature resources
		// resource of this feature will be merged in parent plugin's resources
		// under <parent>.resources.<featureName> property
		resourceJSON: "",
		
		// define all forward names that it can handle, forwards will come only
		// if name is listed here, define each forward name as: 'forwardEvent1Name', 'forwardEvent2Name', ...
		canHandleForwards: ""
	};

	// external files which are to be loaded during initialization process
	// value of each item here should be 
	// { name: "", file: "", cond: "an optional function that returns true/false for conditional include" }
	// files are loaded in specified order one after another
	// files of following types can be included:
	// JavaScript (*.js), Stylesheets (*.css) and Templates (*.html) and any other type of files which
	// are defined in "dynamicHtmlEndPoints" configuration setting
	this.featureInclude = [
	];
	
	// pre-initialization handler
	// called just after feature instance is created any any merging or includes are processed
	// Note: Since 'self' carries plugin reference, to use feature instance reference, use 'this'
	// returns (boolean): true, if feature to be added, false otherwise
	this.onFeaturePreInit = function() {
		// any initialization goes here
		var isSuccess = true;
		
		// return
		return isSuccess;
	};
	
	// initialization handler
	// called when feature is initialized, however yet not merged
	// Note: Since 'self' carries plugin reference, to use feature instance reference, use 'this'
	// returns (boolean): true, if feature to be added, false otherwise
	this.onFeatureInit = function() {
		// any initialization goes here
		var isSuccess = true;
		
		// return
		return isSuccess;
	};

	// load handler
	// called when feature is completely loaded and merged into target
	// Note: Since 'self' carries plugin reference, to use feature instance reference, use 'this'
	// returns (void): 
	this.onFeatureLoad = function() {
	};
	
	// handle parent forwards
	// parent may choose to forward certain scenarios for features to handle
	// feature should know in advance what forwards can come by their exact name
	// params:
	//	forwardName (string): forward name
	//	args (object literal): arguments 
	// returns (object): depends on what forward it is
	this.onParentForward = function(forwardName, args) {
		// handle forward
		var returnValue = null;
		switch(forwardName) {
			case "onInit": break;
			...
		};
		
		// return
		return returnValue;
	};
}); }(fluid));
